package com.bosssoft.boss_exam_core.common.Filter;

import com.bosssoft.boss_exam_core.common.config.security.xss.XssHttpServletRequestWrapper;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;


@WebFilter(filterName="xssFilter",urlPatterns="/")
public class MyXSSFilter implements Filter {
    @Override
    public void destroy() { }
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.err.println("XSSFilter");
        //fixme 测试
        chain.doFilter(new XssHttpServletRequestWrapper((HttpServletRequest) request), response);
    }
    @Override
    public void init(FilterConfig arg0) throws ServletException { }
}
